﻿using SimpleMvvmDemo.Client.Commands;
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;

namespace SimpleMvvmDemo.Client.ViewModels
{
    public class MainWindowViewModel : NotificationObject
    {
        private double _input1;
        private double _input2;

        public double Input1
        {
            get => _input1;
            set
            {
                _input1 = value;
                RaisePropertyChanged();
            }
        }

        public double Input2
        {
            get => _input2;
            set
            {
                _input2 = value;
                RaisePropertyChanged();
            }
        }

        private double _result;

        public double Result
        {
            get => _result;
            set
            {
                _result = value;
                RaisePropertyChanged();
            }
        }

        public DelegateCommand? AddCommand { get; set; }

        public MainWindowViewModel()
        {
            AddCommand = new DelegateCommand(Add, null);
        }

        private void Add(object? parameter)
        {
            Result = Input1 + Input2;
        }

        ButtonBase
    }
}
